package view.mainscreen;

import java.awt.Point;
import controller.Controller;
import model.visibility.PlayerView;
import view.mainscreen.AreaViewport;
import view.ScreenLayout;
import view.Screen;

public class MainScreen extends Screen
{ private static AreaViewport AVP;
  private static StatusViewport SVP;
  //private StatusBar Bar; 
  ScreenLayout layout;
  PlayerView playerView;
  public MainScreen(PlayerView _playerView, Controller controller)
  { super(); 
    playerView = _playerView;
    AVP = new AreaViewport(playerView, controller);
    SVP = new StatusViewport(playerView, controller);
    try
    { //setPoint(0,0);
      //Bar = new StatusBar();
      this.add(AVP);
      this.add(SVP);
      //this.add(Bar);
      this.setScreenLayout();
    } catch (Exception e) { e.printStackTrace(); }
  }
  private void setScreenLayout() 
  { layout = new ScreenLayout();
    layout.setLayoutPoint(AVP, new Point(0,0));
    layout.setLayoutPoint(SVP, new Point(824,0));
    //layout.setLayoutPoint(Bar, new Point(0,565));
    this.setLayout(layout);
  }
  
  public AreaViewport getAreaViewport() 
  { return AVP; }
  public void refreshAreaViewport() 
  {
  	AVP.refreshAreaViewport();
  }
  void refreshStatusViewport()
  { 
    SVP.refreshStatusViewport();
  }
}